/*
 * @Descripttion:调用后端用户接口的函数
 */

import axios from 'axios'

//注册
const register = user =>
	axios.post('/api/test/register', {
		accountName: user.accountName,
		accountPassword: user.accountPassword,
		sex: user.sex,
		address: user.address,
	}).then(res => res.data)
//登录
const login = user =>
	axios.get('/api/test/login', {
		params: {
			accountName: user.accountName,
			accountPassword: user.accountPassword,
		}
	}).then(res => res.data)
//检验token
const checkToken = (token) => axios.get('/api/test/token',{
	params:{
		token:token,
	},
}).then(res => res.data)


export {
	login,
	register,
	checkToken,
}
